#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	int i, j, index, t, min;
	int arr[10] = { 1,4,6,3,5,8,7,2,9,0 };
	for (i = 0; i <= 9; i++)
	{
		for (min = arr[i], j = i + 1, index = i; j <= 9; j++)
		{
			if (min > arr[j])
			{
				min = arr[j];
				index = j;
			}
		}
		if (index != i)
			t = arr[i]; arr[i] = arr[index]; arr[index] = t;
	}
	for (i = 0; i <= 9; i++)
		printf("%d ", arr[i]);
    printf("\n");
}